package com.itranswarp.learnjava;

/**
 * for练习
 */
public class Main {

	public static void main(String[] args) {
		double pi = 0;
		int flag =1;
		for (int i =1; i<999999999; i=i+2 ) {

			pi += flag*(1.0/i );
			flag = -flag;
		}
		pi = 4*pi;

		System.out.printf("圆周率是：%.15f \n",pi);
	}

}
